const fs = require('fs')

const path = require('path')

const res = fs.readFileSync(path.join(__dirname, '/data/info.json'), 'utf-8')

const arr = JSON.parse(res)
const random = parseInt(Math.random() * arr.length);

arr[random].count += 1;

const data = JSON.stringify(arr)
//累加count
fs.writeFileSync(path.join(__dirname, '/data/info.json'), data)
//不累加
// fs.writeFileSync(path.join(__dirname, '/data/info1.json'), data)

